#if 0
#include <cassert>
#include "randset.h"

class CopyTest
{
private:
    RandSet<int> ref;

public:
    CopyTest(RandSet<int> &_set):ref(_set)
    {
        
    }

    void add8toset()
    {
        ref.add(8);
    }
};
void test_randset()
{
    RandSet<int> set1(12);
    set1.add(2);
    set1.add(4);
    set1.add(11);
    //set1.add(12);
    auto fnc_print = [](int v) { printf("%d ", v); };
    auto newline = []() { printf("\n"); };
    set1.for_each(fnc_print);
    newline();
    assert(true == set1.contains(2));
    assert(true == set1.contains(11));

    set1.remove(4);
    set1.remove(2);
    set1.add(0);

    set1.for_each(fnc_print);
    newline();
    assert(true == set1.contains(11));

    //test copy constructor
    //RandSet<int> &setref = set1;
    //set1.add(2);
    printf("-------------\n");
    set1.for_each(fnc_print);
    newline();
    CopyTest test(set1);
    test.add8toset();
    set1.for_each(fnc_print);
    newline();
    //printf("set1ref %d\n",setref.size());

    set1.clear();
    assert(0 == set1.size());

    //set2
    int max_cap = RandSet<int>::CAP_LIMIT;
    RandSet<int> set2(max_cap);
    for (int i = 0; i < max_cap; i++)
    {
        set2.add(i);
    }
    printf("sz of set2 %d\n", set2.size());
    printf("max sz %d\n", max_cap);
    assert(set2.size() == max_cap);

    set2.clear();
    for (int i = 0; i < 1234; i++)
    {
        set2.add(i);
    }
    for (int i = 0; i < 1234; i += 2)
    {
        set2.remove(i);
    }
    printf("sz of randset %d\n", set2.size());
    printf("assert sz == %d\n", 1234 / 2);
    assert(set2.size() == 1234 >> 1);

    //test pset3
    RandSet<int> *pset3 = new RandSet<int>(12);
    pset3->add(1);
    delete pset3;
}

int main()
{
    test_randset();
    return 0;
}
#endif